fit time-range length-pattern or length-zone-reference
fit enables to scale dynamics to a certain time-range. The calculation is done using a length-pattern, or a reference number to a length zone. fit returns the number of times the length items will fit inside the time-range. When this number is used as a length parameter with many generators, absolute scaling can be achieved. fit's length-zone- reference adjusts to the length definitions of the current instrument in current section, and can be used to any contexts, like same-as.
Here the gen-cresc scales to a range 1/2 in both zones. Number one refers to length pattern (1/16) and number 2 refers to length pattern (1/8).
(def-section sect-a
default
zone '(1/1 1/1)
tonality (activate-tonality (major c 4))
length '((1/16) (1/8))
symbol '(-b -c -d)
synth
velocity (list (gen-cresc 12 45 (fit 1/2 1))
(gen-cresc 12 45 (fit 1/2 2)))
synth2
velocity (gen-cresc 12 45 (fit 2/1))
)
(midiport :printer)
(def-tempo 120)
(play-file-p "auto-scale"
synth '(sect-a)
synth2 same
)
If length list is a non-zone pattern like in the following, then length-zone-reference is omitted.
(def-section a
default
zone '(1/1 1/1)
tonality (activate-tonality (major c 4))
length '(1/16 1/8)
symbol '(-b -c -d)
synth
velocity (gen-cresc 12 45 (fit 2/1))
)
(midiport :printer)
(def-tempo 120)
(play-file-p "auto-scale"
synth '(a)
)
What if you have length zones like '((1/16) (1/8)), which go for zones '(1/1 1/1), and want to make a crescendo which lasts more than one zone. This is done in the same way.
(def-section a
default
zone '(1/1 1/1)
tonality (activate-tonality (major c 4))
length '((1/16) (1/8))
symbol '(-b -c -d)
synth
velocity (gen-cresc 12 45 (fit 2/1))
)
(midiport :printer)
(def-tempo 120)
(play-file-p "auto-scale"
synth '(a)
)
Another way to call fit is to supply it with a length pattern:
(gen-cresc 12 45 (fit 1/2 '(1/16 1/8)))
If you want to scale to a given zone number, you can do it with the aid of zone-scale function. Note that this requires that symbol class is previously defined.
(gen-cresc 12 45 (zone-scale 1)) ; scales to first zone = 1/1